package com.tfjybj.itoo.exam.provider.service.impl;

import com.dmsdbj.itoo.tool.base.service.impl.BaseServicePlusImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tfjybj.itoo.exam.entity.StaffEntity;
import com.tfjybj.itoo.exam.model.StaffModel;
import com.tfjybj.itoo.exam.provider.dao.StaffDao;
import com.tfjybj.itoo.exam.provider.service.StaffService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * StaffService接口实现类
 * ${base}表
 *
 * @author 杨江涛
 * @version 2.0.0
 * @since 2.0.0 2018-11-15 10:35:56
 */
@Service("staffService")
public class StaffServiceImpl extends BaseServicePlusImpl<StaffDao, StaffEntity> implements StaffService {

    //region 模板生成
    @Resource

    private StaffDao staffDao;

    @Override
    public PageInfo<StaffModel> queryByLikeName(String name, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return new PageInfo<>(staffDao.queryLikeName(name));
    }

    //endregion

    /* **********************************以下为非模板生成的内容********************************* */

    /**
     * 根据登陆人id和创建考试的开始时间,筛选监考老师
     *
     * @param teacherName 筛选框中的值
     * @param teacherId   登陆老师id
     * @param startTime   考试开始时间
     * @param endTime     考试结束时间
     * @return 返回筛选结果集
     * @author maying
     * @since 2018-12-8 15:23:25
     */
    @Override
    public List<StaffModel> queryInvigilator(String teacherName, String teacherId, String startTime, String endTime) {
        return staffDao.queryInvigilator(teacherName, teacherId, startTime, endTime);
    }


}
